var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (e, i) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, e) {
              t.__proto__ = e;
            }) ||
          function (t, e) {
            for (var i in e)
              Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
          })(e, i);
      };
      return function (e, i) {
        function l() {
          this.constructor = e;
        }
        if ("function" != typeof i && null !== i)
          throw new TypeError(
            "Class extends value " + String(i) + " is not a constructor or null"
          );
        t(e, i),
          (e.prototype =
            null === i
              ? Object.create(i)
              : ((l.prototype = i.prototype), new l()));
      };
    })(),
  DPHeroDetailDialog = (function (t) {
    function e() {
      var e = t.call(this) || this;
      return (
        e.btn_heroDetail_sure.on(Laya.Event.CLICK, e, e.onSureBuyHeroAction),
        e.btn_heroDetail_cancle.on(Laya.Event.CLICK, e, e.onCancleBuyAction),
        (e.pannel_hero.vScrollBarSkin = ""),
        e
      );
    }
    return (
      __extends(e, t),
      (e.showHeroDetailDialog = function (t, i) {
        null == this.detailV &&
          ((this.detailV = new e()), (this.detailV.zOrder = 1e3)),
          this.detailV.popup(!0),
          (this.detailV.heroJson = t),
          (this.detailV.className = ""),
          (this.detailV.className = i),
          this.detailV.initUI();
      }),
      (e.prototype.dealSuboardStar = function (t) {
        var e = "";
        return t > 0 && (e = " (" + t + "星) "), e;
      }),
      (e.prototype.initUI = function () {
        var t = this.heroJson.data;
        (this.label_nickName.text = t.roleName + "(" + t.roleId + ")"),
          (this.label_hdd_title.text =
            t.name + " (" + t.lvl + "级）" + this.dealSuboardStar(t.star)),
          (this.label_hdd_money.text = " 价格：" + this.heroJson.money + "金"),
          "AXFlyMyMarketView" == this.className &&
            ((this.label_hdd_title.text =
              t.name + "(" + t.trans + "转）" + this.dealSuboardStar(t.star)),
            (this.label_hdd_money.text =
              " 价格：" + this.heroJson.money + "银")),
          (this.img_heroDetail_header.skin =
            "fujiangfull/fujiang_" + t.img + ".png");
        var e = t.npcInit;
        (this.label_hdd_touxian.text = "头衔：" + t.title),
          (this.label_hdd_qixue.text = "气血：" + t.hp + "/" + t.maxHp),
          (this.label_hdd_jingli.text = "精力：" + t.mp + "/" + t.maxMp),
          (this.label_hdd_gongji.text = "攻击：" + t.ap),
          (this.label_hdd_fangyu.text = "防御：" + t.df),
          (this.label_hdd_sudu.text = "速度：" + t.sp),
          (this.label_hdd_jineng1.text = "技能1："),
          (this.label_hdd_jineng2.text = "技能2：");
        for (var i = 0; i < t.skillList.length; i++) {
          var l = t.skillList[i],
            a = l.name,
            n = l.hua,
            o = l.grade,
            s = l.useCount,
            h = "";
          n > 0 && (h = "化境" + o),
            (h = (h = h + a + "  ") + s + "熟练度"),
            0 == i
              ? (this.label_hdd_jineng1.text = "技能1：" + h)
              : (this.label_hdd_jineng2.text = "技能2：" + h);
        }
        (this.label_hdd_czl.text = "成长率：" + e.czl + "/" + e.czlMax),
          (this.label_hdd_maxHp.text = "气血初值：" + e.hp + "/" + e.hpMax),
          (this.label_hdd_maxMp.text = "精力初值：" + e.mp + "/" + e.mpMax),
          (this.label_hdd_maxAp.text = "攻击初值：" + e.ap + "/" + e.apMax),
          (this.label_hdd_maxSp.text = "速度初值：" + e.sp + "/" + e.spMax),
          (this.label_hdd_tzd.text = "体质点：" + t.hpp),
          (this.label_hdd_zld.text = "智力点：" + t.mpp),
          (this.label_hdd_lld.text = "力量点：" + t.app),
          (this.label_hdd_mjd.text = "敏捷点：" + t.spp);
      }),
      (e.prototype.onSureBuyHeroAction = function () {
        if ("AXFlyMyMarketView" == this.className) {
          var t = this.heroJson;
          WebSocketService.send({
            c: 1329,
            d: {
              stallId: t.stallId,
              pos: t.item.pos,
              thingId: t.item.thing_id,
              count: t.item.count,
            },
          });
        } else
          WebSocketService.send({
            c: 2097,
            d: { pawnId: this.heroJson.pawnId },
          });
        this.close();
      }),
      (e.prototype.onCancleBuyAction = function () {
        this.close();
      }),
      (e.staticClose = function () {
        null != this.detailV && this.detailV.close();
      }),
      e
    );
  })(ui.MarketController.DPHeroDetailDialogUI);
